package com.un.ebs.sys.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.un.ebs.core.enums.TableTypeEnum;
import com.un.ebs.core.metadata.DbField;
import lombok.Data;
import org.springframework.stereotype.Component;

import java.io.Serializable;

/**
 * (Table)表实体类
 *
 * @author liubo
 * @since 2021-01-08 09:17:30
 */
@Data
@Component
@TableName("sys_table")
@SuppressWarnings("serial")
public class Table extends Model<Table> {

    @TableId(value = "id", type = IdType.UUID)
    private String id;


    @DbField(name = "data_source_id", length = 40, precision = 0)
    private String dataSourceId;

    @DbField(name = "table_name", length = 100, precision = 0)
    private String tableName;

    @DbField(name = "table_desc", length = 100, precision = 0)
    private String tableDesc;

    @DbField(name = "table_type", length = -1, precision = 0)
    private TableTypeEnum tableType;

    @DbField(name = "support_logic_delete", length = -1, precision = 0)
    private Boolean supportLogicDelete;

    @DbField(name = "support_workflow", length = -1, precision = 0)
    private Boolean supportWorkflow;

    @DbField(name = "support_parent", length = -1, precision = 0)
    private Boolean supportParent;

    @DbField(name = "support_operation_log", length = -1, precision = 0)
    private Boolean supportOperationLog;

    @DbField(name = "support_audit", length = -1, precision = 0)
    private Boolean supportAudit;

    @DbField(name = "support_tenant", length = -1, precision = 0)
    private Boolean supportTenant;

    @DbField(name = "support_sort", length = -1, precision = 0)
    private Boolean supportSort;

    @DbField(name = "parent_id", length = 40, precision = 0)
    private String parentId;

    @DbField(name = "is_many", length = -1, precision = 0)
    private Boolean isMany;

    @DbField(name = "is_release", length = -1, precision = 0)
    private Boolean isRelease;

    @DbField(name = "service_name", length = 40, precision = 0)
    private String serviceName;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}